<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%@ include file="/common/meta.jsp" %>
</head>
<body class="login">
<div class="container">
    <h4><p class="bg-success" style="text-align: center;margin-top: 10px">用户管理</p></h4>
    <div class="row">

        <div class="col-md-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <button class="btn btn-success" type="button" id="usListBtn">用户列表</button>
                </div>
            </div>
        </div>
        <div class="col-md-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <button class="btn btn-success" type="button" id="usAddBtn">用户增加</button>
                </div>
            </div>
        </div>
        <div class="col-md-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <button class="btn btn-success" type="button" id="reListBtn">资源管理</button>
                </div>
            </div>
        </div>
        <div class="col-md-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <button class="btn btn-success" type="button" id="roListBtn">角色管理</button>
                </div>
            </div>
        </div>
        <div class="col-md-1">

        </div>
        <div class="col-md-1">

        </div>
        <div class="col-md-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <a class="btn btn-success" type="button" id="InfoBtn">我的信息</a>
                </div>
            </div>
        </div>
        <div class="col-md-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <a class="btn btn-success" type="button" id="sessionTest">session超时测试</a>
                </div>
            </div>
        </div>

        <div class="col-md-1">

        </div>


        <div class="col-md-1">

        </div>

        <div class="col-md-1 col-md-offset-1">
            <div class="form-group">
                <div class="input-group" style="margin: auto">
                    <button class="btn btn-danger" type="button" id="logoutBtn">退出</button>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
<script type="text/javascript" src="${ctx}/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="${ctx}/js/shiro/top.js"></script>
<script>
    $("#sessionTest").bind("click", function () {
        $.ajax({
            url: "/user/test",
            type: "post",
            success: function success(data) {
                alert(data);
            },
            error: function error(err) {
                if (err.status == 401) {
                    alert("登陆超时，请重新登录");
                }
                else if (err.status == 403) {
                    alert("您没有访问权限");
                }
                else {
                    window.location.href = "/user/list";
                }
            }
        });
    });
</script>
</html>
